<?php
JunctionFileCabinet::using("Junction_Utils_Strings");

class Test_Junction_Utils_Strings extends UnitTestCase {
	
	public function testStartsWith() {
		$this->assertTrue(Junction_Utils_Strings::startsWith("foobar", "foo"));
		$this->assertFalse(Junction_Utils_Strings::startsWith("foobar", "bar"));
		$this->assertFalse(Junction_Utils_Strings::startsWith("foobar", "blah"));
	}
	
	public function testFindFirst() {
		$string = "abcdef";
		$pattern = "/def$/";
		$this->assertTrue(Junction_Utils_Strings::findFirst($string, $pattern) == 3);
		$pattern2 = "/^def/";
		$this->assertTrue(Junction_Utils_Strings::findFirst($string, $pattern2) == -1);
	}
}
?>